home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 September / 1984-09.d64 / treasure hunt_64 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  6KB  |  187 lines

  1. 10 poke53280,6:poke53281,1
  2. 21 poke56,48:poke52,48:clr
  3. 25 print"[147][129]*************treasure hunt[146]**************"
  4. 26 print"         redefining characters"
  5. 28 poke56334,peek(56334)and254:poke1,peek(1)and251
  6. 30 fori=0to511:pokei+12288,peek(53248+i):next
  7. 32 poke1,peek(1)or4:poke56334,peek(56334)or1
  8. 40 fori=12288+35*8to12288+47*8+7:reada:pokei,a:next
  9. 41 fori=12288+58*8to12288+61*8+7:reada:pokei,a:next
  10. 45 poke53272,21:gosub800:sn=54272:pokesn+24,15:pokesn+5,17:pokesn+6,240
  11. 49 pokesn,100:gosub200
  12. 50 poke53272,(peek(53272)and240)or12:rn=rn+1:p=1:q=40
  13. 55 gosub510:gosub1000:gosub1300
  14. 60 cl=1902
  15. 65 js=peek(56320)and15
  16. 70 tl=cl:z=cl:onjs-4gosub94,92,93,99,96,98,97,99,95,91,99
  17. 75 cl=z:pokesn+1,50:pokesn+4,33:gosub300
  18. 76 ifflandnotdfthengosub650
  19. 77 pokesn+4,32:ifdfthen1600
  20. 79 poketl,32:poketl+q,32
  21. 80 pokecl,46:pokecl+q,47:pokecm+cl,3:pokecm+q+cl,3:gosub540:ifgc<2andgb<2then50
  22. 85 gosub600:ifdfthen1600
  23. 90 goto65
  24. 91 z=z-q:return
  25. 92 z=z-39:return
  26. 93 z=z+p:return
  27. 94 z=z+41:return
  28. 95 z=z+q:return
  29. 96 z=z+39:return
  30. 97 z=z-p:return
  31. 98 z=z-41:return
  32. 99 return
  33. 200 print"[152]enter skill level 1-5"
  34. 210 geta$:ifa$=""then210
  35. 220 aa=val(a$):ifaa<1oraa>5then210
  36. 230 return
  37. 300 rem collision chk
  38. 302 tc=0:ifpeek(cl)=35orpeek(cl+q)=35orpeek(cl)=36orpeek(cl+q)=36thentc=p
  39. 303 ifpeek(cl)=37orpeek(cl+q)=37orpeek(cl)=38orpeek(cl+q)=38thentc=p
  40. 304 ifpeek(cl)=39orpeek(cl+q)=39orpeek(cl)=40orpeek(cl+q)=40thentc=p
  41. 305 ifpeek(cl)=41orpeek(cl+q)=41thentc=p
  42. 306 iftcthencl=tl:return
  43. 308 if(peek(cl)=47andpeek(cl+q)=32)or(peek(cl)=32andpeek(cl+q)=46)thenreturn
  44. 309 ifpeek(cl)=32andpeek(cl+q)=32thenreturn
  45. 310 ifpeek(cl)=46andpeek(cl+q)=47thenreturn
  46. 312 ifpeek(cl)=42orpeek(cl+q)=42then400
  47. 315 ifpeek(cl)=61orpeek(cl+q)=61thengb=gb-p:sc=sc+10*aa:pokesn+1,30:pokesn+4,33
  48. 320 ifpeek(cl)=60orpeek(cl+q)=60thengc=gc-p:sc=sc+aa:pokesn+1,80:pokesn+4,33
  49. 323 ifpeek(cl)=43orpeek(cl+q)=43orpeek(cl)=44orpeek(cl+q)=44then450
  50. 325 ifpeek(cl)=45orpeek(cl+q)=45then650
  51. 330 return
  52. 400 remdead from skul
  53. 405 poketl,32:poketl+q,32:pokecl,46:pokecl+q,47:pokecl+cm,0:pokecl+cm+q,0
  54. 410 goto700
  55. 450 rem at bog
  56. 452 d=int(rnd(1)*10)+1
  57. 453 jb=not(-(peek(56320)and16)/16)
  58. 455 ifjbandpeek(cj)=59andd>2thencl=ch:pokeci,32:sc=sc+100*aa:fg=p:return
  59. 460 ifjbandpeek(cj)<>59andd>2thencl=cl+47:goto300
  60. 465 cl=ch+41:poketl,32:poketl+q,32:pokecl,46:pokecm+cl,3:goto700
  61. 500 rem border
  62. 510 print"[147]":cm=54272
  63. 520 fori=1024to1063:pokei,35:pokecm+i,14:next
  64. 525 fori=1103to2023step40:pokei,35:pokecm+i,14:next
  65. 530 fori=1982to1943step-1:pokei,35:pokecm+i,14:next
  66. 535 fori=1984to1064step-40:pokei,35:pokecm+i,14:next
  67. 536 return
  68. 539 rem scor+tres chst
  69. 540 print"[159]round"rn"score"sc;:iffgthen555
  70. 545 rd=int(rnd(1)*15)
  71. 550 onrdgosub555,555,555,555,555,555,561,555,555,555,555,555,563,555,555
  72. 555 return
  73. 561 ifpeek(ci)=32andpeek(cj)=32thenpokeci,58:pokecj,59:pokeci+cm,6:pokecj+cm,6
  74. 562 return
  75. 563 ifpeek(ci)=58thenpokeci,32:pokecj,32
  76. 564 return
  77. 600 remmoveskulls
  78. 605 d=int(rnd(1)*aa)+1:ondgosub641,642,643,644,645
  79. 608 ts=sk:z=sk:pokesk,32
  80. 610 onint(rnd(1)*8)+1gosub91,92,93,94,95,96,97,98
  81. 615 sk=z:ifpeek(sk)=32thenondgosub1381,1382,1383,1384,1385:goto625
  82. 620 ifpeek(sk)=46orpeek(sk)=47then400
  83. 622 sk=ts
  84. 625 pokesk,42:pokesk+cm,7:return
  85. 641 sk=s1:return
  86. 642 sk=s2:return
  87. 643 sk=s3:return
  88. 644 sk=s4:return
  89. 645 sk=s5:return
  90. 650 remstagger
  91. 655 poketl,32:poketl+q,32:pokecl,46:pokecl+q,47:pokecl+cm,4:pokecl+cm+q,4
  92. 660 pokesn+1,40:pokesn+4,33:fori=1to10:next:pokesn+1,45:fori=1to25:next
  93. 662 pokesn+4,32
  94. 665 tl=cl:z=cl:onint(rnd(1)*8)+1gosub91,92,93,94,95,96,97,98
  95. 670 cl=z:iffl=.thenfl=p:goto300
  96. 680 iffl=pthenfl=.:goto300
  97. 700 remdeadsound
  98. 710 pokesn+1,40:pokesn+4,33:forx=1to5:pokesn+1,40:forl=1to50:next:pokesn+1,20
  99. 715 forl=1to50:next:next:pokesn+4,32
  100. 720 df=1:return
  101. 800 print"[147][151]you are hunting lost pirate treasure on ";
  102. 810 print"a secluded island.                      ";
  103. 820 print"guide the hunter with joystick #2 to the";
  104. 830 print"coins, gold bars and a treasure chest.  ";
  105. 831 print"the treasure chest is surrounded by a   ";
  106. 832 print"bog.  you have a 70% chance of crossing ";
  107. 835 print"by pressing the fire button as you      ";
  108. 836 print"approach.                               ";
  109. 838 print"[156]the treasure has a death curse on it and";
  110. 839 print"is guarded by the evil spirits of       ";
  111. 840 print"ancient pirates who make the treasure   ";
  112. 841 print"chest disappear and reappear from time  ";
  113. 842 print"to time.                                ";
  114. 854 print"the evil spirits also have placed kegs  ";
  115. 855 print"of rum around the island to distract    ";
  116. 856 print"treasure hunters.                       ";
  117. 857 print"[154]if the treasure hunter drinks rum, he   ";
  118. 858 print"will stagger and you can't guide him.   ";
  119. 860 print"you earn points as shown:               ";
  120. 865 print"coin=1 x skill level                    ";
  121. 866 print"bar=10 x skill level                    ";
  122. 867 print"treasure chest=100 x skill level        ";
  123. 880 return
  124. 999 rembuild palmgrove
  125. 1000 tb=int(rnd(1)*8)+2:print"":i=int(rnd(1)*3)+1:forx=0toi:print"":next
  126. 1005 printtab(tb)"&%'&%'"
  127. 1006 printtab(tb)"($&%')&%'"
  128. 1010 printtab(tb)"$($&%'$)"
  129. 1015 printtab(tb)"$($)$"
  130. 1020 printtab(tb)"$ $ $"
  131. 1023 printtab(tb)"$[144]  ,+"
  132. 1025 printtab(tb)"$:; [144],"
  133. 1027 printtab(tb)",+"
  134. 1028 printtab(tb)"+,+,"
  135. 1030 ch=peek(209)+256*peek(210)-(160-(tb+7)):cj=ch+q:ci=cj-p
  136. 1035 return
  137. 1300 rem build screen
  138. 1301 fori=pto7*aa
  139. 1302 x=int(rnd(1)*720)+1064
  140. 1305 ifpeek(x)<>32orpeek(x+p)<>32orpeek(x-p)<>32orpeek(x+q)<>32then1302
  141. 1306 ifpeek(x-q)<>32then1302
  142. 1310 pokex,45:pokecm+x,4:next
  143. 1320 fori=pto6*aa
  144. 1325 x=int(rnd(1)*720)+1064
  145. 1330 ifpeek(x)<>32orpeek(x+p)<>32orpeek(x-p)<>32orpeek(x+q)<>32then1325
  146. 1331 ifpeek(x-q)<>32then1325
  147. 1335 pokex,42:pokecm+x,0:next
  148. 1360 fori=ptoaa
  149. 1365 sk=int(rnd(1)*720)+1064:ifpeek(sk)<>42then1365
  150. 1370 pokesk+cm,7
  151. 1375 onigosub1381,1382,1383,1384,1385
  152. 1380 next:goto1400
  153. 1381 s1=sk:return
  154. 1382 s2=sk:return
  155. 1383 s3=sk:return
  156. 1384 s4=sk:return
  157. 1385 s5=sk:return
  158. 1400 gc=25:b=60:fori=1to25
  159. 1410 gosub1450
  160. 1415 ifpeek(x)<>32orpeek(x+q)><32orpeek(x-q)><32then1410
  161. 1420 pokex,b:pokecm+x,7:next
  162. 1430 gb=5:b=61:fori=1to5
  163. 1435 gosub1450
  164. 1437 ifpeek(x)<>32orpeek(x+q)><32orpeek(x-q)><32then1435
  165. 1440 pokex,b:pokecm+x,7:next
  166. 1445 return
  167. 1450 x=int(rnd(1)*755)+1064:return
  168. 1600 remgameover
  169. 1605 pokesn+4,32:poke53272,21
  170. 1610 print"[147][158]another victim of the pirate's curse!!!"
  171. 1611 print"skill level:"aa
  172. 1612 print"rounds:"rn
  173. 1613 print:print"score:"sc
  174. 1615 print:print"play again?"
  175. 1620 geta$:ifa$=""then1620
  176. 1625 ifa$="y"thenrn=0:fl=0:fg=0:df=0:sc=0:print"[147]":goto49
  177. 1630 end
  178. 6060 data255,255,255,255,255,255,255,255,28,28,28,28,28,28,28,28
  179. 6065 data129,227,247,255,255,255,255,156,15,127,127,227,143,63,113,243
  180. 6070 data248,254,254,227,249,252,207,227,199,159,62,56,120,96,96,64,121,120,28
  181. 6071 data14,6,6,7,
  182. 6075 data60,126,90,126,126,36,60,24,28,63,31,255,255,127,124,56
  183. 6080 data60,254,255,255,243,120,56,60,28,62,62,62,62,62,62,28
  184. 6085 data60,126,219,255,102,60,24,255,189,189,189,189,36,36,36,102
  185. 6087 data15,31,63,63,63,63,63,63,248,252,254,254,254,254,254,254
  186. 6090 data,,,24,24,,,,,,,127,127,,,0
  187.